import 'dart:ui' show Color;

enum ImageType {
  JPEG("image/jpeg"),
  PNG("image/png"),
  GIF("image/gif"),
  BMP("image/bmp"),
  WEBP("image/webp"),
  HEIC("image/heic");

  const ImageType(this.type);

  final String type;
}

class OhosOptions {
  const OhosOptions({
    this.maxImages,
    this.isPhotoTakingSupported,
    this.exceptMimeType,
  });

  /// Maximum number of selectable images.
  ///
  /// Defaults to 300.
  final int? maxImages;

  /// Is the camera displayed on the selection page.
  ///
  /// Defaults to false.
  final bool? isPhotoTakingSupported;

  /// Filtered mime type 排除的MIME类型
  final Set<ImageType>? exceptMimeType;

  Map<String, String> toJson() {
    print('MultiImagePickerPlusPlugin- maxImages: ${maxImages}');
    print('MultiImagePickerPlusPlugin- isPhotoTakingSupported: ${isPhotoTakingSupported}');
    print('MultiImagePickerPlusPlugin- exceptMimeType: ${exceptMimeType}');
    return {
      "maxImages": (maxImages ?? 500).toString(),
      "isPhotoTakingSupported": isPhotoTakingSupported == true ? "true" : "false",
      "exceptMimeType":
          exceptMimeType?.map((e) => e.type).toList().join(',') ?? '',
    };
  }
}
